package com.chuangjiangx.member.manager.basic.web.config;

import com.chuangjiangx.member.manager.basic.web.config.springsession.CustomerJdkSerializationRedisSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * @author cj-ch
 * @date 2018/8/16 下午2:12
 */
@EnableRedisHttpSession
public class SpringSessionConfig {

    @Bean("springSessionDefaultRedisSerializer")
    public RedisSerializer<Object> springSessionDefaultRedisSerializer(){
//        Jackson2JsonRedisSerializer<Object> serializer = new Jackson2JsonRedisSerializer<Object>(Object.class);
//        ObjectMapper objectMapper = new ObjectMapper();
//        objectMapper.getDeserializationConfig().without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
//        objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//        serializer.setObjectMapper(objectMapper);
        return new CustomerJdkSerializationRedisSerializer();
//        return serializer;
    }



}
